package com.itheima.health.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ReportDao {
    /**
     * 获取所有套餐名称
     * @return
     */
    @Select("select name from t_setmeal")
    List<String> getSetmealNames();

    /**
     * 根据套餐名称获取套餐id
     * @param s
     * @return
     */
    @Select("select id from t_setmeal where name = #{s}")
    Integer getSetmealIdByName(String s);

    /**
     * 根据套餐id获取套餐预约数量
     * @param id
     * @return
     */
    @Select("select count(id) from t_order where setmeal_id = #{id}")
    Integer getSetmealCountByName(Integer id);
}
